# coding=utf-8
"""
Author: Mr.夏末
@Function: 关键字驱动效果
"""
from class21.interkeys import Inter

# 创建关键字对象
inter = Inter()
inter.seturl('http://www.testingedu.com.cn:8081/inter/HTTP')

# inter.post("http://www.testingedu.com.cn:8081/inter/HTTP/auth")
# inter.addheader('token',inter.jsonres.get('token'))
# inter.post("http://www.testingedu.com.cn:8081/inter/HTTP/login", {
#     'username': 'hzs01',
#     'password': '123456'
# })
# inter.post("http://www.testingedu.com.cn:8081/inter/HTTP/logout")

# 按需求封装
inter.reauth()
inter.post("http://www.testingedu.com.cn:8081/inter/HTTP/login", 'username=hzs&password=123456')

inter.reauth()
inter.post("login", "{'username': 'hzs01', 'password': '123456'}")

inter.reauth()
inter.post("login", '{"username": "hzs02", "password": "123456","t":true}')

# 消除登录对其他人的影响
inter.post("logout")
